namespace Glpt.Common
{
    /// <summary>
    /// 字典类
    /// </summary>
    public class DictElement
    {
        private string dict_value = "";
        private string dict_text = "";
        private object dict_object = null;

        /// <summary>
        /// 初始化类的新实例
        /// </summary>
        /// <param name="value">字典值</param>
        /// <param name="text">字典文本</param>
        public DictElement(string value, string text)
        {
            dict_value = value;
            dict_text = text;
        }

        /// <summary>
        /// 初始化类的新实例
        /// </summary>
        /// <param name="value">字典值</param>
        /// <param name="text">字典文本</param>
        /// <param name="tag">对象</param>
        public DictElement(string value, string text, object tag)
        {
            dict_value = value;
            dict_text = text;
            dict_object = tag;
        }

        /// <summary>
        /// 获取或是设置字典值
        /// </summary>
        public string Value
        {
            get
            {
                return dict_value;
            }
            set
            {
                dict_text = value;
            }
        }
        /// <summary>
        /// 获取或是设置字典文本
        /// </summary>
        public string Text
        {
            get
            {
                return dict_text;
            }
            set
            {
                dict_text = value;
            }
        }

        /// <summary>
        /// 获取或设置包含有关控件的数据的对象。
        /// </summary>
        public object Tag
        {
            get
            {
                return dict_object;
            }
            set
            {
                dict_object = value;
            }
        }

        /// <summary>
        /// 返回表示当前对象的 System.String
        /// </summary>
        /// <returns>String对象</returns>
        public override string ToString()
        {
            return dict_text;
        }
    }
}
